//
//  Cellofxib.m
//  DSSH
//
//  Created by Fuhao on 16/4/11.
//  Copyright © 2016年 lcy. All rights reserved.
//

#import "Cellofxib.h"
#import "CusAlterview.h"
@implementation Cellofxib

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/
-(void)setInfo:(celldata *)info
{
    _xxlable.text = info.maintitle;
    _timesla.text = info.timestitle;
    if(info.datasta == Databeup )
    {
        [self.timesla setHidden:NO];
        [self.upbutton setHidden:YES];
        [self.reupbutton setHidden:NO];
    }
    
}
- (IBAction)reupbutton:(id)sender {
    
    
}
- (IBAction)upbuttonAction:(id)sender {
    
    DSSHLog(@"upbutton");
    Reachability *r= [Reachability reachabilityForInternetConnection];
    if([r currentReachabilityStatus] == ReachableViaWiFi){//如果应用在非WIFI下3G
        if([self.delegate respondsToSelector:@selector(upbuttonofcell:Netsta:)]){
            [self.delegate upbuttonofcell:self Netsta:NO];
        }
    }
    if([r currentReachabilityStatus] == NotReachable){
        [self makeToast:@"网络未连接"];
        
    }
    
}
+(id)initWithxib:(NSString *)xibName
{
    
    return [[NSBundle mainBundle] loadNibNamed:xibName owner:self options:nil][0];
}
-(void)awakeFromNib
{
    _upbutton.layer.cornerRadius = 5 ;
    _upbutton.layer.borderWidth = 1;
    _upbutton.layer.borderColor = [UIColor redColor].CGColor;
    _reupbutton.layer.cornerRadius = 5 ;
    _reupbutton.layer.borderWidth = 1;
    _reupbutton.layer.borderColor = [UIColor redColor].CGColor;
    self.userInteractionEnabled = YES;
}
@end
